$(function () {
    $.ajax({
        url: "/cart/getgoods"
    }).done(function (res) {
        console.log(res);
        let strHtml = '<div class="tabcurrent">';
        res.data.forEach(function (item, index) {
            if (index == 0) {
                strHtml += `
                <div class="zj3zleft">
                    <img src="${item.img}" class="ss" style="opacity: 1;">
                    <p>周年庆省钱卡 花3元得34元红包</p>
                    <p>￥3</p>
                
                </div>`
            } else {
                strHtml += `
                    <div class="zj3zright1">
                            <a href="./pages.html?id=${item.id}">
                            <img src="${item.img}" class="ss" style="opacity: 1;">
                            <p>${item.name} <br>${item.desc}</p>
                            <p>￥${item.price}</p>
                            </a><a href="./carts.html" class="acarts">加入购物车</a>
                            
                    </div>
                `
            }
        })
        strHtml += `</div>`;

        $(".dtcj").html(strHtml);
        // $(document).lazyload1()


    })


})